﻿// -------------------------------------------------------------------------
//    @FileName         :    NFTransAccBase.h
//    @Author           :    Gao.Yi
//    @Date             :    2025-08-17
//    @Email			:    445267987@qq.com
//    @Module           :    NFTransAccBase
//    @Desc             :    
//
// -------------------------------------------------------------------------

#pragma once

#include "NFComm/NFObjCommon/NFObject.h"
#include "NFLogicCommon/NFBaseDefine.h"
#include "NFLogicCommon/NFLogicShmTypeDefines.h"
#include "NFServerComm/NFServerCommon/NFCacheDataGetTrans.h"

class NFSession;
class NFTransAccBase : public NF_OBJECT_TEMPLATE_MACRO(NFTransAccBase, EOT_TRANS_LOGIC_ACC_BASE, NFCacheDataGetTrans)
public:
    NFTransAccBase();
    ~NFTransAccBase() override;
    int CreateInit();
    int ResumeInit();
public:
    int Init(NFSession *pSession, uint32_t cmd, uint32_t csSeq);
public:
    int SetClientSession(NFSession *pSession);

    NFSession *GetClientSession() const;

    int GetClientSessionID() const { return m_iClientSessionID; }

    uint16_t GetClientRequestSeq() const { return m_stCSMsgHeadReq.m_iSeqCS; }

    int GetClientRequestMsgID() const { return (int) m_stCSMsgHeadReq.m_iMsgID; }

    const CSMsgHead *GetCSMsgHeadReq() const { return &m_stCSMsgHeadReq; }
public:
    std::string DebugString() const override;
protected:
    int m_iClientSessionID;
    CSMsgHead m_stCSMsgHeadReq;
    int m_zoneId;
    uint64_t m_uin;
};
